<@_model id=id>
	<#assign a=object/>
	<#if object.parentId??><#assign parentId=object.parentId/></#if>
</@_model>
<script>
var mo_i=1;
function appendExtend($box,replaceStr){
	return $($.parseHTML($('#ex_new').text().replace(eval("/_new_/gi"),replaceStr), document, true)).appendTo($box);
}
function prependExtend($box,replaceStr){
	return $($.parseHTML($('#ex_new').text().replace(eval("/_new_/gi"),replaceStr), document, true)).prependTo($box);
}
<#if id?has_content>
$(function(){
<@_extendList itemType=1 itemId=id>
	<#list page.list as a>
		<#assign pre='ex_c_'/>
	$temp=appendExtend($('#ex_content',navTab.getCurrentPanel()),'_c_${a.id!}_');
		<#if a.isRequired>
	$('input[name=${pre}${a.id!}_required]',$temp).click();
		</#if>
	$('input[name=${pre}${a.id!}_name]',$temp).val('${(a.name?js_string)!}');
	$('select[name=${pre}${a.id!}_inputType]',$temp).val('${(a.inputType?js_string)!}');
	$('input[name=${pre}${a.id!}_code]',$temp).val('${(a.code?js_string)!}');
	$('input[name=${pre}${a.id!}_defaultValue]',$temp).val('${(a.defaultValue?js_string)!}');
	$('textarea[name=${pre}${a.id!}_description]',$temp).val('${(a.description?js_string)!}');
	$temp.initUI();
	</#list>
</@_extendList>
});
</#if>
</script>
<textarea id="ex_new" style="display:none">
<#assign extendFieldList=['modelExtend1','modelExtend2','modelExtend3','modelExtend4']/>
<#include "../include_page/extendHtml.html"/>
</textarea>
<div class="pageContent">
	<form method="post" action="cmsModel/save.do?callbackType=closeCurrent&navTabId=cmsModel" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone);">
		<input name="id" type="hidden" value="${id!}" />
		<input name="parentId" type="hidden" value="${parentId!}" />
		<div class="pageFormContent" layoutH="57">
			<fieldset>
				<legend><@t.m 'moudle.model'/>属性</legend>
				<dl class="nowrap">
					<dt><@t.m 'moudle.model'/><@t.m 'field.name'/>：</dt>
					<dd>
						<input class="required" name="name" type="text" maxlength="20" size="20" value="${(a.name)!}"/>
						<label>
							<input name="isUrl" type="checkbox" onclick="if($(this).is(':checked')){$('.isUrl').hide();$('.isUrl input[type=text]',navTab.getCurrentPanel()).val('');}else{$('.isUrl').show();}"/>
							链接
						</label>
						<label><input name="isImages" type="checkbox" onclick="if($(this).is(':checked')){$('input[name=hasChild]',navTab.getCurrentPanel()).parent().hide();}else{$('input[name=hasChild]',navTab.getCurrentPanel()).parent().show();}"/>图集</label>
						<label><input name="hasChild" type="checkbox"/>拥有<@t.m 'moudle.child'/><@t.m 'moudle.model'/></label>
					</dd>
				</dl>
			<#if a??>
				<script>
				<#if a.isImages>
					$('input[name=isImages]',navTab.getCurrentPanel()).click();
				<#else>
					<#if a.hasChild>
					$('input[name=hasChild]',navTab.getCurrentPanel()).click();
					</#if>
				</#if>
				</script>
			</#if>
				<dl class="isUrl nowrap">
					<#assign temp><@t.m 'moudle.content'/></#assign>
					<dt>${(a.name)!temp}<@t.m 'moudle.template'/><@t.m 'moudle.path'/>：</dt>
					<dd>
						<input name="templatePath" type="text" maxlength="200" size="30" value="${(a.templatePath)!}"/>
						<a class="btnLook" href="cmsTemplate/lookup.html?field=templatePath&value=${(a.templatePath)!}" lookupGroup="">选择</a>
					</dd>
				</dl>
			<#if a??&&a.isUrl>
				<script>
					$('input[name=isUrl]',navTab.getCurrentPanel()).click();
				</script>
			</#if>
			</fieldset>
			<fieldset>
				<#assign temp><@t.m 'moudle.contentExtend'/></#assign>
				<legend>${(a.name)!temp}</legend>
				<dl class="nowrap">
					<dt></dt>
					<dd><a class="buttonActive" href="javascript:prependExtend($('#ex_content',navTab.getCurrentPanel()),'_new_c_'+(mo_i++)+'_').initUI();"><span>增加字段</span></a></dd>
				</dl>
				<div id="ex_content"></div>
			</fieldset>
		</div>
		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit"><@t.m 'button.save'/></button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="button" class="close"><@t.m 'button.cancel'/></button></div></div></li>
			</ul>
		</div>
	</form>
</div>